home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ham Radio
/
Ham Radio CD-ROM (Emerald Software) (1995).ISO
/
misc
/
hamutil2
/
sconvert.bas
< prev
next >
Wrap
BASIC Source File
|
1979-12-31
|
1KB
|
33 lines
100 CLS :REM"SCONVERT"
110 PRINT TAB(31);"**** SCONVERT ****"
120 PRINT :PRINT "THIS PROGRAM CONVERTS S(11) DATA FROM MAGNITUDE / ANGLE";
130 PRINT " to R +- JX" :PRINT
140 PRINT :BEEP :INPUT "ENTER S(11) MAGNITUDE & PHASE THUS: M,P ";M,A
150 RAD=(4*ATN(1))/180 :R=10^(M/20)
160 ZN=(1-R^2)/(1+R^2-2*R*COS(A*RAD))
170 Z=ABS(ZN)*50 :Z=INT(Z*100)/100
180 XN=2*R*SIN(A*RAD)/(1+R^2-2*R*COS(A*RAD))
190 X=ABS(XN)*50 :X=INT(X*100)/100
200 I=Z*(1+(X/Z)^2) :I=INT(I*100)/100
210 IF XN<>0 THEN 230
220 J=99999! :GOTO 240
230 J=(Z^2+X^2)/X :J=INT(J*100)/100
240 IF SGN(XN)=-1 THEN 260
250 S$="+" :GOTO 270
260 S$="-"
270 CLS :PRINT TAB(28);"CONJUGATE IMPEDANCE DATA" :PRINT :PRINT
280 PRINT "S(11)=";M;"DB <";A;"Degrees converts to:" :PRINT
290 PRINT "AN EQUIVALENT SERIES IMPEDANCE of ";Z;S$;"J";X;" or": PRINT
300 PRINT "AN EQUIVALENT PARALLEL IMPEDANCE of ";I;S$;"J";J
310 PRINT :BEEP :PRINT "HARD COPY REQUIRED? (Y/N)"
320 P$=INKEY$ :IF P$="" THEN 320
330 IF P$="N" THEN 380
340 IF P$<>"Y" THEN 320
350 LPRINT "S(11)=";M;"DB";CHR$(60);A;"DEG. converts to a SERIES IMPED. of";
360 LPRINT Z;S$;"J";X :LPRINT "or an EQUIVALENT PARALLEL IMPEDEDANCE of";I;S$;
370 LPRINT "J";J :LPRINT
380 PRINT :BEEP :PRINT "CONTINUE? (Y/N)"
390 A$=INKEY$ :IF A$="" THEN 390
400 IF A$="Y" THEN 100
410 IF A$<>"N" THEN 390 ELSE END